//
//  AppDelegate+Reachability.m
//  jiajia
//
//  Created by 如佳 陈 on 16/5/9.
//  Copyright © 2016年 sunrisin. All rights reserved.
//

#import "AppDelegate+Reachability.h"
#import <AFNetworking/AFNetworkReachabilityManager.h>

@implementation AppDelegate (Reachability)

- (void)registerReachabilityForApplication:(UIApplication *)application andOptions:(NSDictionary *)launchOptions {
    AFNetworkReachabilityManager *manager = [AFNetworkReachabilityManager sharedManager];
    [manager startMonitoring];
    [manager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
        [[NSNotificationCenter defaultCenter] postNotificationName:NCNetworkStatusChanged object:@(status)];
    }];
}

@end
